# **************************************
# --*-- coding: utf-8 --*--
# @Time    : 2024-03-21
# @Author  : white
# @FileName: singleton.py
# @Software: PyCharm
# **************************************
def singleton(func):
    instance = dict()

    def wrapper(*args, **kwargs):
        if func not in instance.keys():
            instance[func] = func(*args, **kwargs)
        return instance[func]

    return wrapper
